
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <title>首页 · React源码解析</title>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.0">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-theme-api/theme-api.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

         
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    

<script
  async
  src="https://www.googletagmanager.com/gtag/js?id=UA-49483742-5"
></script>
<script>
  window.dataLayer = window.dataLayer || []
  function gtag() {
    dataLayer.push(arguments)
  }
  gtag('js', new Date())

  gtag('config', 'UA-49483742-5')
</script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter active" data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    首页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    基础
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="book/api/react.html">
            
                <a href="book/api/react.html">
            
                    
                    React API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="book/api/react-element.html">
            
                <a href="book/api/react-element.html">
            
                    
                    ReactElement
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="book/api/react-children.html">
            
                <a href="book/api/react-children.html">
            
                    
                    React Children
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="book/api/react-structure.html">
            
                <a href="book/api/react-structure.html">
            
                    
                    React 中的数据结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    创建更新
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="book/update/react-dom-render.html">
            
                <a href="book/update/react-dom-render.html">
            
                    
                    ReactDOM.render
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="book/update/set-state.html">
            
                <a href="book/update/set-state.html">
            
                    
                    setState & forceUpdate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="book/update/expiration-time.html">
            
                <a href="book/update/expiration-time.html">
            
                    
                    expirationTime 计算
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    任务调度
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="book/flow/scheduler-global.html">
            
                <a href="book/flow/scheduler-global.html">
            
                    
                    全局变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="book/flow/schedule-work.html">
            
                <a href="book/flow/schedule-work.html">
            
                    
                    scheduleWork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="book/flow/scheduler-pkg.html">
            
                <a href="book/flow/scheduler-pkg.html">
            
                    
                    react-scheduler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="book/flow/perform-work.html">
            
                <a href="book/flow/perform-work.html">
            
                    
                    performWork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="book/flow/perform-unit-of-work.html">
            
                <a href="book/flow/perform-unit-of-work.html">
            
                    
                    performUnitOfWork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="book/flow/render-root.html">
            
                <a href="book/flow/render-root.html">
            
                    
                    renderRoot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.6.1" data-path="book/flow/render-root/throw-exception.html">
            
                <a href="book/flow/render-root/throw-exception.html">
            
                    
                    throwException
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="book/flow/begin-work.html">
            
                <a href="book/flow/begin-work.html">
            
                    
                    beginWork
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.7.1" data-path="book/flow/begin-work/mount-indeterminate-component.html">
            
                <a href="book/flow/begin-work/mount-indeterminate-component.html">
            
                    
                    mountIndeterminateComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.2" data-path="book/flow/begin-work/mount-lazy-component.html">
            
                <a href="book/flow/begin-work/mount-lazy-component.html">
            
                    
                    mountLazyComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.3" data-path="book/flow/begin-work/update-functional-component.html">
            
                <a href="book/flow/begin-work/update-functional-component.html">
            
                    
                    updateFunctionalComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.4" data-path="book/flow/begin-work/update-class-component.html">
            
                <a href="book/flow/begin-work/update-class-component.html">
            
                    
                    updateClassComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.5" data-path="book/flow/begin-work/update-host-root.html">
            
                <a href="book/flow/begin-work/update-host-root.html">
            
                    
                    updateHostRoot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.6" data-path="book/flow/begin-work/update-host-component.html">
            
                <a href="book/flow/begin-work/update-host-component.html">
            
                    
                    updateHostComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.7" data-path="book/flow/begin-work/update-host-text.html">
            
                <a href="book/flow/begin-work/update-host-text.html">
            
                    
                    updateHostText
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.8" data-path="book/feature/Suspense-component.md">
            
                <span>
            
                    
                    updateSuspenseComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.9" data-path="book/flow/begin-work/update-portal-component.html">
            
                <a href="book/flow/begin-work/update-portal-component.html">
            
                    
                    updatePortalComponent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.10" data-path="book/flow/begin-work/update-forward-ref.html">
            
                <a href="book/flow/begin-work/update-forward-ref.html">
            
                    
                    updateForwardRef
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.11" data-path="book/flow/begin-work/update-fragment.html">
            
                <a href="book/flow/begin-work/update-fragment.html">
            
                    
                    updateFragment
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.12" data-path="book/flow/begin-work/update-mode.html">
            
                <a href="book/flow/begin-work/update-mode.html">
            
                    
                    updateMode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.13" data-path="book/flow/begin-work/update-profiler.html">
            
                <a href="book/flow/begin-work/update-profiler.html">
            
                    
                    updateProfiler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.14" data-path="book/flow/begin-work/update-context-provider.html">
            
                <a href="book/flow/begin-work/update-context-provider.html">
            
                    
                    updateContextProvider
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7.15" data-path="book/flow/begin-work/update-context-consumer.html">
            
                <a href="book/flow/begin-work/update-context-consumer.html">
            
                    
                    updateContextConsumer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="book/flow/reconcile-children.html">
            
                <a href="book/flow/reconcile-children.html">
            
                    
                    reconcileChildren
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.8.1" data-path="book/flow/reconcile-children/single.html">
            
                <a href="book/flow/reconcile-children/single.html">
            
                    
                    调和单个节点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8.2" data-path="book/flow/reconcile-children/array.html">
            
                <a href="book/flow/reconcile-children/array.html">
            
                    
                    调和列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    commit 阶段
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="book/commit-phase/commit-root.html">
            
                <a href="book/commit-phase/commit-root.html">
            
                    
                    commitRoot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="book/commit-phase/invokeGuardedCallback.html">
            
                <a href="book/commit-phase/invokeGuardedCallback.html">
            
                    
                    invokeGuardedCallback
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="book/commit-phase/commitBeforeMutationLifecycles.html">
            
                <a href="book/commit-phase/commitBeforeMutationLifecycles.html">
            
                    
                    commitBeforeMutationLifecycles
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="book/commit-phase/commit-all-host-effects.html">
            
                <a href="book/commit-phase/commit-all-host-effects.html">
            
                    
                    commitAllHostEffects
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.4.1" data-path="book/commit-phase/host-effects/CommitPlacement.html">
            
                <a href="book/commit-phase/host-effects/CommitPlacement.html">
            
                    
                    commitPlacement
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4.2" data-path="book/commit-phase/host-effects/CommitWork.html">
            
                <a href="book/commit-phase/host-effects/CommitWork.html">
            
                    
                    commitWork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4.3" data-path="book/commit-phase/host-effects/CommitDeletion.html">
            
                <a href="book/commit-phase/host-effects/CommitDeletion.html">
            
                    
                    commitDeletion
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="book/commit-phase/commit-all-lifecycles.html">
            
                <a href="book/commit-phase/commit-all-lifecycles.html">
            
                    
                    commitAllLifecycle
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    功能
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="book/features/context.html">
            
                <a href="book/features/context.html">
            
                    
                    context
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="book/features/hydrate.html">
            
                <a href="book/features/hydrate.html">
            
                    
                    hydrate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="book/features/ref.html">
            
                <a href="book/features/ref.html">
            
                    
                    ref
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="book/features/event-injection.html">
            
                <a href="book/features/event-injection.html">
            
                    
                    事件系统初始化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="book/features/event-bind.html">
            
                <a href="book/features/event-bind.html">
            
                    
                    事件绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="book/features/event-dispatch.html">
            
                <a href="book/features/event-dispatch.html">
            
                    
                    事件触发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="book/features/event-create-event-object.html">
            
                <a href="book/features/event-create-event-object.html">
            
                    
                    事件对象生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="book/features/Suspense-component.html">
            
                <a href="book/features/Suspense-component.html">
            
                    
                    Suspense
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="book/features/suspense.html">
            
                <a href="book/features/suspense.html">
            
                    
                    挂起任务的含义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="book/features/suspense-lazy.html">
            
                <a href="book/features/suspense-lazy.html">
            
                    
                    lazy 组件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    Hooks
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="book/hooks/hooks-start.html">
            
                <a href="book/hooks/hooks-start.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="book/hooks/hooks-use-state.html">
            
                <a href="book/hooks/hooks-use-state.html">
            
                    
                    useState
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="book/hooks/hooks-use-effect.html">
            
                <a href="book/hooks/hooks-use-effect.html">
            
                    
                    useEffect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="book/hooks/hooks-others.html">
            
                <a href="book/hooks/hooks-others.html">
            
                    
                    其他API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="book/hooks/hooks-common.html">
            
                <a href="book/hooks/hooks-common.html">
            
                    
                    通用API
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <form
            action="https://buttondown.email/api/emails/embed-subscribe/Jokcy"
            method="post"
            target="popupwindow"
            onsubmit="window.open('https://buttondown.email/Jokcy', 'popupwindow')"
            class="buttondown-form"
            >
            <input type="email" name="email" id="bd-email" placeholder="(your@email.com)">
            <input type="hidden" value="1" name="embed"/>
            <button type="submit">订阅我</button>
        </form>
    </li>
</ul>

                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                 
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >首页</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="react-&#x6E90;&#x7801;&#x89E3;&#x6790;">React &#x6E90;&#x7801;&#x89E3;&#x6790;</h1><blockquote><p>&#x672C;&#x6587;&#x6863;&#x7684;&#x5185;&#x5BB9;&#x57FA;&#x672C;&#x5DF2;&#x7ECF;&#x5B8C;&#x6210;&#x4E86;&#xFF0C;&#x4F1A;&#x4EE5;&#x6587;&#x6863;&#x7684;&#x5F62;&#x5F0F;&#x7EE7;&#x7EED;&#x66F4;&#x65B0;&#xFF0C;&#x6301;&#x7EED;&#x5B8C;&#x5584;&#x5185;&#x5BB9;&#x3002;</p></blockquote><iframe scrolling="no" style="width:100%!important;height:220px;border:1px #ccc solid !important" src="https://buttondown.email/Jokcy?as_embed=true"></iframe>



<p>&#x5728;&#x5F00;&#x59CB;&#x60F3;&#x5199;&#x672C;&#x4E66;&#x4E4B;&#x524D;&#xFF0C;&#x6211;&#x5DF2;&#x7ECF;&#x82B1;&#x4E86;&#x5C06;&#x8FD1;&#x4E00;&#x4E2A;&#x6708;&#x7684;&#x65F6;&#x95F4;&#x9605;&#x8BFB; React &#x7684;&#x6E90;&#x7801;&#xFF0C;&#x5728;&#x771F;&#x6B63;&#x505A;&#x4E4B;&#x524D;&#xFF0C;&#x6211;&#x4E00;&#x76F4;&#x89C9;&#x5F97;&#x8FD9;&#x4E0D;&#x4F1A;&#x662F;&#x4E00;&#x4EF6;&#x5F88;&#x96BE;&#x7684;&#x4E8B;&#x60C5;&#xFF0C;&#x4F46;&#x662F;&#x5230;&#x771F;&#x6B63;&#x5F00;&#x59CB;&#x9605;&#x8BFB;&#x4E4B;&#x540E;&#xFF0C;&#x6211;&#x624D;&#x53D1;&#x73B0;&#xFF0C;&#x4E8B;&#x60C5;&#x5E76;&#x6CA1;&#x6709;&#x6211;&#x60F3;&#x7684;&#x90A3;&#x4E48;&#x7B80;&#x5355;&#x3002;</p><p>&#x9605;&#x8BFB;&#x6E90;&#x7801;&#x7684;&#x5173;&#x952E;&#x662F;&#x4F60;&#x8981;&#x53BB;&#x731C;&#x4E00;&#x5F00;&#x59CB;&#x5F00;&#x53D1;&#x8005;&#x4E3A;&#x4EC0;&#x4E48;&#x4F1A;&#x8FD9;&#x4E48;&#x53BB;&#x8BBE;&#x8BA1;&#xFF0C;&#x800C;&#x4E00;&#x4E2A;&#x5F00;&#x6E90;&#x6846;&#x67B6;&#x548C;&#x5355;&#x7EAF;&#x7684;&#x4E00;&#x4E2A;&#x524D;&#x7AEF;&#x9879;&#x76EE;&#x7684;&#x4EE3;&#x7801;&#x5DEE;&#x8DDD;&#x662F;&#x5F88;&#x5927;&#xFF0C;&#x8BBE;&#x8BA1;&#x7684;&#x89D2;&#x5EA6;&#x4E5F;&#x662F;&#x975E;&#x5E38;&#x4E0D;&#x540C;&#x7684;&#xFF0C;&#x4F60;&#x4E0D;&#x80FD;&#x7528;&#x5F00;&#x53D1;&#x9879;&#x76EE;&#x7684;&#x601D;&#x7EF4;&#x53BB;&#x8003;&#x8651;&#x4E00;&#x4E2A;&#x5F00;&#x6E90;&#x6846;&#x67B6;&#x7684;&#x8BBE;&#x8BA1;&#x521D;&#x8877;&#x3002;&#x66F4;&#x4E0D;&#x7528;&#x8BF4;&#x56E0;&#x4E3A;&#x81EA;&#x5DF1;&#x773C;&#x754C;&#x7684;&#x95EE;&#x9898;&#xFF0C;&#x4E00;&#x4E9B;&#x4E4B;&#x524D;&#x81EA;&#x5DF1;&#x57FA;&#x672C;&#x6CA1;&#x7528;&#x8FC7;&#x4EE3;&#x7801;&#x5199;&#x6CD5;&#xFF0C;&#x5728;&#x6E90;&#x7801;&#x4E2D;&#x770B;&#x5230;&#x7684;&#x65F6;&#x5019;&#x7740;&#x5B9E;&#x6709;&#x70B9;&#x4E00;&#x8138;&#x61F5;&#x903C;&#x3002;&#x6BD4;&#x5982;&#x518D;&#x770B;&#x5230;<code>React Fiber</code>&#x4E2D;&#x5173;&#x4E8E;<code>TypeOfMode</code>&#x7684;&#x8BBE;&#x8BA1;&#x7684;&#x65F6;&#x5019;</p><pre><code class="lang-js"><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> NoContext = <span class="hljs-number">0b000</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> AsyncMode = <span class="hljs-number">0b001</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> StrictMode = <span class="hljs-number">0b010</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> ProfileMode = <span class="hljs-number">0b100</span></code></pre>
<p>&#x4E00;&#x5F00;&#x59CB;&#x6839;&#x672C;&#x6CA1;&#x6709;&#x53CD;&#x5E94;&#x8FC7;&#x6765;&#x53BB;&#x8003;&#x8651;&#x8FD9;&#x4E48;&#x8BBE;&#x8BA1;&#x662F;&#x4E3A;&#x4E86;&#x7B80;&#x5316;&#x7C7B;&#x578B;&#x6BD4;&#x8F83;&#xFF0C;&#x4EE5;&#x53CA;&#x7C7B;&#x578B;&#x590D;&#x5408;&#x7684;&#x65B9;&#x5411;&#x3002;&#x5982;&#x679C;&#x5728;&#x4EE5;&#x524D;&#x81EA;&#x5DF1;&#x9879;&#x76EE;&#x5F00;&#x53D1;&#x7684;&#x65F6;&#x5019;&#x6709;&#x63A5;&#x89E6;&#x8FC7;&#x4E00;&#x4E9B;<em>&#x590D;&#x5408;&#x6743;&#x9650;&#x7CFB;&#x7EDF;</em>&#x7684;&#x8BBE;&#x8BA1;&#xFF0C;&#x90A3;&#x4E48;&#x53EF;&#x80FD;&#x7B2C;&#x4E00;&#x773C;&#x5C31;&#x80FD;&#x53CD;&#x5E94;&#x8FC7;&#x6765;&#x3002;</p><p>&#x518D;&#x6BD4;&#x5982;&#x4F5C;&#x4E3A;&#x524D;&#x7AEF;&#x5F00;&#x53D1;&#x8005;&#xFF0C;&#x6211;&#x5BF9;&#x4E8E;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x5E76;&#x6CA1;&#x6709;&#x7279;&#x522B;&#x6DF1;&#x5165;&#x5B66;&#x4E60;&#xFF0C;&#x6240;&#x4EE5;&#x518D;&#x770B;&#x5230;<code>firstEffect.nextEffect</code>&#x5230;<code>lastEffect</code>&#x8FD9;&#x79CD;&#x5355;&#x5411;&#x94FE;&#x8868;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x8BBE;&#x8BA1;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E00;&#x5F00;&#x59CB;&#x4E5F;&#x8001;&#x662F;&#x628A;&#x81EA;&#x5DF1;&#x641E;&#x6DF7;&#xFF0C;&#x641E;&#x4E0D;&#x6E05;&#x695A;&#x8FD9;&#x91CC;&#x9762;&#x7684;&#x542B;&#x4E49;&#x5230;&#x5E95;&#x662F;&#x4EC0;&#x4E48;&#x3002;</p><p>&#x5728;&#x5F00;&#x7BC7;&#x8BF4;&#x8FD9;&#x4E9B;&#xFF0C;&#x5C31;&#x662F;&#x60F3;&#x8BF4;&#x4E00;&#x4E0B;&#x81EA;&#x5DF1;&#x7ECF;&#x5386;&#x8FD9;&#x6BB5;&#x65F6;&#x95F4;&#x5B66;&#x4E60; React &#x7684;&#x6E90;&#x7801;&#x5F97;&#x5230;&#x7684;&#x4E00;&#x4E9B;&#x65B0;&#x7684;&#x3002;<strong>&#x9605;&#x8BFB;&#x6E90;&#x7801;&#x5E76;&#x4E0D;&#x53EA;&#x662F;&#x8BA9;&#x4F60;&#x6DF1;&#x5165;&#x7684;&#x7406;&#x89E3;&#x4E00;&#x4E2A;&#x6846;&#x67B6;&#x7684;&#x8FD0;&#x4F5C;&#x539F;&#x7406;&#xFF0C;&#x66F4;&#x80FD;&#x8BA9;&#x4F60;&#x5728;&#x4E00;&#x4E9B;&#x5B9E;&#x73B0;&#x65B9;&#x6848;&#x4E0A;&#x5B66;&#x4E60;&#x5230;&#x4E00;&#x4E9B;&#x66F4;&#x4F18;&#x7684;&#x65B9;&#x6CD5;</strong></p><p><strong>&#x5728;&#x7F16;&#x7A0B;&#x4E16;&#x754C;&#xFF0C;&#x6211;&#x4EEC;&#x5982;&#x679C;&#x4E0D;&#x7CBE;&#x8FDB;&#x5C31;&#x662F;&#x9000;&#x6B65;&#xFF0C;&#x4E0D;&#x662F;&#x4E48;&#xFF1F;</strong></p><p>&#x56DE;&#x5230;&#x4E3B;&#x9898;&#xFF0C;&#x6211;&#x603B;&#x7ED3;&#x4E86;&#x4E00;&#x4E0B;&#x8981;&#x7406;&#x89E3; React &#x539F;&#x7406;&#x6700;&#x6838;&#x5FC3;&#x7684;&#x90E8;&#x5206;&#xFF1A;</p><ul><li>&#x66F4;&#x65B0;&#x673A;&#x5236;
</li>
<li>&#x4EC0;&#x4E48;&#x662F;<code>Fiber</code>&#x4EE5;&#x53CA;&#x4F5C;&#x7528;
</li>
<li>React &#x5B9E;&#x73B0;&#x8DEF;&#x66F4;&#x65B0;&#x4EFB;&#x52A1;&#x7684;&#x8C03;&#x5EA6;&#xFF0C;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x7684;
</li></ul>
<p>&#x8FD9;&#x4E09;&#x9879;&#x662F;&#x6211;&#x8BA4;&#x4E3A;&#x7406;&#x89E3; React &#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x6700;&#x56F0;&#x96BE;&#x7684;&#x90E8;&#x5206;&#x3002;</p><p>&#x4F60;&#x73B0;&#x5728;&#x770B;&#x5230;&#x7684;&#x7F51;&#x7AD9;&#x7C7B;&#x4F3C;&#x4E8E;<em>&#x8BFB;&#x4E66;&#x7B14;&#x8BB0;</em>&#xFF0C;&#x662F;&#x6211;&#x4E00;&#x8FB9;&#x770B;&#x4EE3;&#x7801;&#x4E00;&#x904D;&#x8BB0;&#x4E0B;&#x6765;&#x7684;&#xFF0C;&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x6211;&#x91C7;&#x7528;&#x8DEF;<code>Gitbook</code>&#x7684;<code>Theme Api</code>&#x4E3B;&#x9898;&#xFF0C;&#x91C7;&#x7528;&#x5DE6;&#x8FB9;&#x8BB0;&#x5F55;&#xFF0C;&#x53F3;&#x8FB9;&#x653E;&#x7F6E;&#x6E90;&#x7801;&#x7684;&#x65B9;&#x5F0F;&#x3002;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x975E;&#x5E38;&#x4FBF;&#x4E8E;&#x9605;&#x8BFB;&#x6E90;&#x7801;&#x3002;</p><p>&#x800C;&#x540C;&#x65F6;&#x6211;&#x4E5F;&#x5728;&#x68B3;&#x7406;&#x6574;&#x4F53;&#x7684;&#x7406;&#x5FF5;&#xFF0C;&#x4EE5;&#x5C3D;&#x91CF;&#x5C11;&#x5F97;&#x5C55;&#x793A;&#x4EE3;&#x7801;&#x6765;&#x6E05;&#x6670;&#x5F97;&#x8BB2;&#x8BC9; React &#x7684;&#x6838;&#x5FC3;&#x539F;&#x7406;&#xFF0C;&#x5BF9;&#x4E8E;&#x6CA1;&#x6709;&#x7A33;&#x5B9A;&#x65F6;&#x95F4;&#x7528;&#x4E8E;&#x9605;&#x8BFB;&#x4EE3;&#x7801;&#x7684;&#x540C;&#x5B66;&#x6765;&#x8BF4;&#xFF0C;&#x662F;&#x975E;&#x5E38;&#x597D;&#x5F97;&#x5B66;&#x4E60; React &#x539F;&#x7406;&#x7684;&#x65B9;&#x5F0F;&#x3002;&#x6700;&#x7EC8;&#x53EF;&#x80FD;&#x4F1A;&#x4EE5;&#xFF1A;</p><ul><li>&#x7C7B;&#x4F3C;&#x6398;&#x91D1;&#x5C0F;&#x518C;
</li>
<li>&#x89C6;&#x9891;&#x8BFE;&#x7A0B;
</li></ul>
<p>&#x7684;&#x65B9;&#x5F0F;&#x5C55;&#x73B0;&#x51FA;&#x6765;&#x3002;&#x8FD9;&#x662F;&#x6211;&#x82B1;&#x65F6;&#x95F4;&#x7CBE;&#x529B;&#x6574;&#x7406;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x5F53;&#x7136;&#x4E5F;&#x5E0C;&#x671B;&#x80FD;&#x7ED9;&#x81EA;&#x5DF1;&#x5E26;&#x6765;&#x4E00;&#x70B9;&#x5229;&#x76CA;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x613F;&#x610F;&#x4E3A;&#x77E5;&#x8BC6;&#x4ED8;&#x8D39;&#xFF0C;&#x90A3;&#x4E48;&#x53EF;&#x4EE5;&#x652F;&#x6301;&#x4E00;&#x4E0B;&#xFF0C;&#x5177;&#x4F53;&#x65B9;&#x5F0F;&#x540E;&#x7EED;&#x4F1A;&#x653E;&#x51FA;&#x3002;</p><p><strong>&#x5F53;&#x7136;&#xFF0C;&#x672C;&#x7F51;&#x7AD9;&#x6C38;&#x4E45;&#x514D;&#x8D39;&#x5E76;&#x4E14;&#x4F1A;&#x8DDF;&#x968F;&#x7248;&#x672C;&#x6301;&#x7EED;&#x66F4;&#x65B0;&#x3002;</strong></p><p>&#x63A5;&#x4E0B;&#x6765;&#x5C55;&#x793A;&#x4E00;&#x4E0B; React &#x7684;&#x8C03;&#x5EA6;&#x8FC7;&#x7A0B;&#xFF1A;</p><p><img alt="FiberScheduler" src="https://k2facq.dm.files.1drv.com/y4moYVQixfYY02TZJM_jIqaj5ynq3-40CaJedwTfjeVz3H19UKoFIhbFI5ws8RJhCE4KJk73oF_EpFnR56ylk6KI6NYxA0UBIWGNfYceY0hm06ITSqniDIRBF-7LUiut5TUfEMiFvNzepHsF7PAQR4n3uWCsofOouwaIVXuiSlA1YisHyb70dffwYh64SaeYqYC4ENuEWYqm_qjg9KDjCnoTw?width=1763&amp;height=1694&amp;cropmode=none"></p><p>&#x4EE5;&#x53CA;&#x6E32;&#x67D3;&#x66F4;&#x65B0;&#x7684;&#x8FC7;&#x7A0B;</p><p><img alt="ReactScheduler" src="https://jgfacq.dm.files.1drv.com/y4mlappMlJu85m_1P4H0wcoQBX_N8AyZoYJxw5JT19hm1sJ6dsblS5ZQOmdtHtFklf3l-lRtmX1nGaw31EUda8tOy9116LJPQlOpjHMOssHTq4Xue4eIiG7MSyp5MZ0KOeWP8fxvJCOsoStnEw8rbSlDjxjdO-I9faPAUQtIklI1zA-qvENd8J8D8y8fiks23W2j3Ur-KoxYu__6fsgCbXzHA?width=1923&amp;height=1793&amp;cropmode=none"></p><p>&#x5728;&#x8FD9;&#x4E2A;&#x7F51;&#x7AD9;&#x4F60;&#x770B;&#x5230;&#x7684;&#x5185;&#x5BB9;&#x4F1A;&#x4E3B;&#x8981;&#x56F4;&#x7ED5;&#x7740;&#x8FD9;&#x4E24;&#x8005;&#x6765;&#xFF0C;&#x8FD9;&#x4E5F;&#x662F; React &#x5F53;&#x4E2D;&#x6700;&#x590D;&#x6742;&#x7684;&#x90E8;&#x5206;&#x3002;&#x90A3;&#x4E48;&#x8BDD;&#x4E0D;&#x591A;&#x8BF4;&#xFF0C;&#x8BF7;&#x7EE7;&#x7EED;&#x9605;&#x8BFB;&#x5427;&#x3002;</p>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
<div id="disqus_thread"></div>
<script>
  /**
   *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
   *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
  /*
var disqus_config = function () {
this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
*/
  ;(function() {
    // DON'T EDIT BELOW THIS LINE
    var d = document,
      s = d.createElement('script')
    s.src = 'https://react-source-code.disqus.com/embed.js'
    s.setAttribute('data-timestamp', +new Date())
    ;(d.head || d.body).appendChild(s)
  })()
</script>
<noscript
  >Please enable JavaScript to view the
  <a href="https://disqus.com/?ref_noscript"
    >comments powered by Disqus.</a
  ></noscript
>

            </div>

            

        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"首页","level":"1.1","depth":1,"next":{"title":"基础","level":"1.2","depth":1,"ref":"","articles":[{"title":"React API","level":"1.2.1","depth":2,"path":"book/api/react.md","ref":"book/api/react.md","articles":[]},{"title":"ReactElement","level":"1.2.2","depth":2,"path":"book/api/react-element.md","ref":"book/api/react-element.md","articles":[]},{"title":"React Children","level":"1.2.3","depth":2,"path":"book/api/react-children.md","ref":"book/api/react-children.md","articles":[]},{"title":"React 中的数据结构","level":"1.2.4","depth":2,"path":"book/api/react-structure.md","ref":"book/api/react-structure.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["theme-api"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["weibo","google","twitter","weibo","instapaper"]},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-api":{"languages":[],"split":true,"theme":"light"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"React源码解析","language":"zh-hans","gitbook":"*"},"file":{"path":"README.md","mtime":"2019-01-28T08:33:58.844Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2019-07-08T12:28:32.264Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-theme-api/theme-api.js"></script>
        
    

    </body>
</html>

